<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<div id="page-content" class="page-content">
		<div class="panel panel-default oparePanel">
			<div class="panel-body">
				
				<div class="searchBox">
				    <c:if test="${noticeFlag ==1 }">
					   <select id="searchStr" name="searchStr" onchange="notice.search(1);" placeholder="" class="input_search">
					      <option value="" <c:if test="${ approveStatus eq '9'}"> selected="selected"</c:if>>全部</option>
					      <option value="0" <c:if test="${ approveStatus eq '0'}"> selected="selected"</c:if> >未审批</option>
					      <option value="-1" <c:if test="${approveStatus eq '-1'}"> selected="selected"</c:if> >已审批</option>
					   </select>
					   <input type="submit"  class="btn_search" onclick="notice.search(1);"/>
					</c:if>
					<c:if test="${noticeFlag == 0 }">
					   <select id="searchStr" name="searchStr" onchange="notice.search(0);" placeholder="" class="input_search">
					      <option value="" <c:if test="${status eq '9'}"> selected="selected"</c:if>>全部</option>
					      <option value="0" <c:if test="${status eq '0'}"> selected="selected"</c:if> >未读</option>
					      <option value="1" <c:if test="${status eq '1'}"> selected="selected"</c:if> >已读</option>
					   </select>
					   <input type="submit"  class="btn_search" onclick="notice.search(0);"/>
					</c:if>
				</div>
				
		       
				<div class="opare">
					<%-- 
					<c:if test="${noticeFlag == 0 }">
						 <input type="button"  value="标识为已读" class="btn a-modefiy" onclick="notice.read();"/>
					</c:if>
					
					<c:if test="${noticeFlag ==1 }">
					     <input type="button"  value="通过" class="btn a-modefiy" onclick="notice.approve();"/>
					     <input type="button"  value="不通过" class="btn a-delet" onclick="notice.approve();"/>
					</c:if>
					--%>
				</div>
		
			</div>
		</div>
		
		<div class="portlet-body">
			<div class="table-scrollable">
				<table class="table table-condensed flip-content">
					<thead class="flip-content">
						<tr>
							<th width="20%">通知内容</th>
							<th width="10%">通知类型</th>
							<th width="10%">状态</th>
							<th width="10%">创建人</th>
							<th width="20%">创建时间</th>
							<th width="30%" class="text-center">
							 <c:if test="${noticeFlag == 0 }">
							     是否已读
							 </c:if>
							 <c:if test="${noticeFlag ==1 }">
							     是否已审批
							 </c:if>
							</th>
						</tr>
					</thead>
					<tbody id="select_tbody">
					   <c:if test="${result.code eq 'SUCCESS' }">
					     <c:forEach items="${result.data.rows}" var ="row" varStatus="status">
						     <tr>
								 <td width="20%" class="">${row.content }</td> 
								 <td width="10%" class="">
								 <!--0-新建用户，1-审批通过，2-审批失败，3-锁定，4-停用, 5-解锁待审批，6-启用待审批, 7-查询审批，8-报警通知 -->
								 <c:choose>  
								   <c:when test="${row.noticeType eq '0'}"> 
								                       新增用户审批
								   </c:when>  
								   <c:when test="${row.noticeType eq '1'}"> 
								                       审批通过通知
								   </c:when> 
								   <c:when test="${row.noticeType eq '2'}"> 
								                       审批失败通知
								   </c:when> 
								   <c:when test="${row.noticeType eq '3'}"> 
								                       锁定用户通知
								   </c:when> 
								   <c:when test="${row.noticeType eq '4'}"> 
								                       停用用户通知
								   </c:when> 
								   <c:when test="${row.noticeType eq '5'}"> 
								         	用户解锁审批
								   </c:when>  
								   <c:when test="${row.noticeType eq '6'}"> 
								     		启用用户审批
								   </c:when>  
								   <c:when test="${row.noticeType eq '70'}"> 
								     		代理查询审批
								   </c:when> 
								   <c:when test="${row.noticeType eq '71'}"> 
								     		司法查询审批
								   </c:when> 
								   <c:when test="${row.noticeType eq '8'}"> 
								     		报警通知
								   </c:when> 
								   <c:when test="${row.noticeType eq '9'}"> 
								     		加班申请通知
								   </c:when> 
								</c:choose> 
								</td>
								<td width="10%" class="">
								    <c:choose>
								       <c:when test="${row.noticeFlag == 1 }">
								            <c:choose>
								               <c:when test="${row.approveStatus == 0 }">
								                 		  待审批
								               </c:when>
								               <c:when test="${row.approveStatus == 1 }">
								                 		  通过
								               </c:when>
								               <c:when test="${row.approveStatus == 2 }">
								                 		  未通过
								               </c:when>
								               <c:otherwise>
								              			  未知
								               </c:otherwise>
								            </c:choose>
								       </c:when>
								       <c:when test="${row.noticeFlag == 0 }">
								            <c:choose>
								               <c:when test="${row.status == 0 }">
								                 		  未读
								               </c:when>
								               <c:when test="${row.status == 1 }">
								                 		  已读
								               </c:when>
								               <c:otherwise>
								              			  未知
								               </c:otherwise>
								            </c:choose>
								       </c:when>
								       <c:otherwise>
								           	未知
								       </c:otherwise>
								    </c:choose>
								    
								</td>
								<td width="10%" class="">${row.creator }</td>
								<td width="20%" class=""><fmt:formatDate value="${row.createTime }" pattern="yyyy-MM-dd HH:mm:ss" /> </td>
								<td width="30%" class="text-center">
								  <c:if test="${row.noticeFlag == 1}">
								      <c:if test="${row.approveStatus == 0  }">
									      <a href="javascript:void(0);" onclick="notice.approve('${row.id}', 1);" class="a-modefiy ">通过</a>
										  <a href="javascript:void(0);" onclick="notice.approve('${row.id}', 2);" class="a-delet ">不通过</a>
								      </c:if>
									  <c:if test="${row.approveStatus != 0  }">
									      <a href="javascript:void(0);"  class="a-modefiy disabled">已审批</a>										  
								      </c:if>
								  </c:if>
								  <c:if test="${row.noticeFlag == 0}">
									  <c:if test="${row.status == 0  }">
									      <a href="javascript:void(0);" onclick="notice.read('${row.id}', 1);" class="a-modefiy ">标识为已读</a>
								      </c:if>
									  <c:if test="${row.status != 0  }">
									      <a href="javascript:void(0);" class="a-modefiy disabled">已读</a>
								      </c:if>
								  </c:if>
								</td>
							</tr>
					    </c:forEach>
					   </c:if>
		
					</tbody>
				</table>
			</div>
		</div>
</div>

<c:if test="${result.code eq 'SUCCESS' }">
  
  <script type="text/javascript">

	  	Page.navigation('page', 'notice/page/view?noticeFlag=${noticeFlag}', 'notice:page', '${result.data.pageSize}', '${result.data.total}', '${result.data.pageCount}', '${result.data.currPage}', 'menuUrl');
  </script>
  
  <div id="page" class="page"> </div>

</c:if>

<div class="clearfix"></div>
